<?php
/**
 *  User dialog form contents
 */
?>
  
  <div class="profil_info">
       
    <a href="<?php echo base_url()."profile/edit-photo/{$user->id}.htm"; ?>" target="_blank" >
        <?if( $image!= NULL )            
             $image = "<img src='".base_url()."profile/image/thumb/{$user->id}/{$image->name}' alt='{$user->username}'>";            
           else
             $image = "<img src='".base_url()."img/no_photo.gif' alt=''>";
        echo "<td>".$image;?>
   </a>
    
    <h1><?php echo $user->username; ?></h1>
    <a href="<?php echo base_url(). "/profile/edit-profile/{$user->id}.htm"; ?>" target="_blank" ><?php echo lang('view_profile'); ?></a>
  </div>
  
  <h2><?php echo lang('conversations');?></h2>
  <div  class="dialog_table">
  <table width='100%' cellpadding=3px cellspacing=0>
    <thead>
      <tr>
        <th><?=lang('from')?></th>
        <th><?=lang('to')?></th>
        <th ><?=lang('number')?></th>
        <th ><?=lang('last_message')?></th>
        <th ><?=lang('complete_dialog')?></th>
      </tr>
    </thead>  
    <tbody >
      <?php
      if( count($messages)>0 )
      foreach ($messages as $row)
      {
        echo "<tr>\n";
          echo "<td><a href='".base_url()."/user/{$row->from}'>{$row->username_from}</a></td>\n";
          echo "<td><a href='".base_url()."/user/{$row->to}'>{$row->username_to}</a></td>\n";
          echo "<td align='center'>{$row->nr_messages}</td>\n";
          echo "<td>{$row->time}</td>\n";
          
          echo "<td><a href='".base_url()."administration/dialogs/index/{$row->id_from}/{$row->id_to}'>".lang('show_dialog')."</td>\n"; //administration/dialogs/index/5/6
        echo "</tr>\n\n";
      }
      else
        echo "<tr><td>".lang('no_conversations')."</td></tr>";
      
      ?>
    </tbody>
    
  </table>
  </div>
  
  
  
  <h2><?php echo lang('transactions');?></h2>
  <div  class="dialog_table">
  <table width='100%' cellpadding=3px cellspacing=0>
    <thead>
      <tr>
        <th>ID</th>
        <th><?=lang('amount')?></th>
        <th ><?=lang('coins')?></th>
        <th ><?=lang('time')?></th>
        <th ><?=lang('provider')?></th>
        <th ><?=lang('status')?></th>
        <th>IP</th>
        <th ><?=lang('error')?></th>
        <th >Extra</th>
      </tr>
    </thead>  
    <tbody >
      <?php
      if( count($transactions)>0 )
      foreach ($transactions as $row)
      {
        $coins = $this->config->item($row->amount);
        echo "<tr>\n";
          echo "<td>{$row->transaction_id}</td>\n";
          echo "<td>{$row->amount}</td>\n";
          echo "<td>{$coins}</td>\n";
          echo "<td>{$row->date}</td>\n";
          echo "<td>{$row->provider}</td>\n";
          echo "<td>{$row->status}</td>\n";
          echo "<td>{$row->ip_address}</td>\n";
          echo "<td>{$row->error}</td>\n";
          echo "<td>{$row->extra}</td>\n";
        echo "</tr>\n\n";
      }
      else
        echo "<tr><td>".lang('no_transactions')."</td></tr>";
      
      ?>
    </tbody>
    
  </table>
  </div>

